Method for Operating a Bus System, in particular a CAN Bus

ABSTRACT

A method for operating a bus system, in particular a CAN bus is disclosed. Several stations can be connected to the bus system. A transmitted message has an identifier, wherein a certain identifier (for example, IDENT) always may be used only by a single station. Each of the stations compares the identifier of a transmitted message with the identifiers the station itself uses (for example, IDENT 2 ). An error message is produced in the event of a match.

PRIOR ART

The invention relates to a method for the operation of a bus system,particularly what is known as a CAN bus (CAN=controller area network).

In the case of a CAN bus, each transmitted message contains what isknown as an identifier. This identifier is used by the stationsconnected to the CAN bus to decide whether the transmitted message isrelevant to them. The identifier is added by the sending station to theuser data that are to be transmitted. In this case, each station is ableto send any number of messages with different identifiers. Eachidentifier can be used only by one particular station, however, and oneand the same identifier cannot be added to a message by differentstations.

A CAN bus is designed such that new stations can be connected withoutrelatively great complexity. Inter alia, this allows an identifier whichis already being used by an existing station to be erroneously used byanother station, for example one newly added, too.

It is an object of the invention to recognize errors in connection withthe use of identifiers.

DISCLOSURE OF THE INVENTION

The invention achieves this object by means of a method according toclaim 1.

The invention permits a particular identifier only ever to be used by asingle station. Each of the stations compares the identifier of atransmitted message with the identifiers which it uses itself. In theevent of a match, an error message is produced.

If, therefore, for whatever reasons, any identifier is used by twodifferent stations, the method according to the invention is used by oneof the two stations to recognize this no later than when the otherstation first sends the identifier which is already in use as part of amessage. The invention thus ensures that a message having a particularidentifier can only ever come from a single station.

Further features, opportunities for application and advantages of theinvention can be found in the description below of exemplary embodimentsof the invention which are shown in the figures of the drawing. In thiscontext, all features described or shown, separately or in anycombination, form the subject matter of the invention, regardless oftheir summary in the patent claims or the back-references therein andalso regardless of their wording or illustration in the description orin the drawings.

FIG. 1 shows a schematic block diagram of an exemplary embodiment of abus system according to the invention, FIG. 2 shows a schematicillustration of a message in the bus system in FIG. 1, and FIG. 3 showsa method for the operation of the bus system in FIG. 1.

FIG. 1 shows a bus system 10, which may be what is known as a CAN bus(CAN=controller area network), in particular. The bus system 10 in FIG.1 is in the form of a serial bus system to which, for example, fourstations 11, 12, 13, 14 are connected. If the bus system 10 is used in amotor vehicle, for example, the stations 11, 12, 13, 14 may be an enginecontroller and/or a drive controller or the like, for example.

The stations 11, 12, 13, 14 of the bus system 10 are designed to haveequal authorization and are able to send and receive messages 20. Thestructure of such a message 20 will be described in more detail belowwith reference to FIG. 2. At one particular time, it is only everpossible for one of the stations 11, 12, 13, 14 to access the bus system10 and to send its message 20. The message 20 sent can then be receivedand, where appropriate, processed by all other stations 11, 12, 13, 14.

Each message 20 transmitted by the bus system 10 has a prescribedformat. FIG. 2 shows a detail from such a message 20. Accordingly, themessage 20 contains at least one “identifier” IDENT and the user datafor DATA that are to be transmitted. The identifier IDENT and the userdata DATA are produced by the sending station. In the case of a CAN bus,the identifier IDENT may be 11 bits or 29 bits long, for example.

Each of the stations 11, 12, 13, 14 is able to send any number ofmessages 20 with different identifiers IDENT. The nonsending stationsthen take the identifier IDENT as a basis for deciding whether or notthe received message 20 is relevant to them. If the message 20 isrelevant to one of the stations 11, 12, 13, 14, the message 20 is readin and processed by this station.

An essential aspect is that a particular identifier IDENT can only everbe sent by a single station. This means that a particular identifier isalways an explicit reference to a single particular station. In otherwords, this means that one and the same identifier IDENT cannot be usedby two different stations.

It will now be assumed that the station 11 sends messages with theidentifier IDENT1, the station 12 sends messages with the identifierIDENT2 and the station 13 sends messages with the identifier IDENT3. Itwill also be assumed that the station 14—erroneously—sends messages withthe identifier IDENT2. This error cannot be recognized by the stations11, 13, since, on the basis of the identifier IDENT2, they always assumethat the associated message comes from the station 12, that is to sayeven if it is the—erroneous—message from the station 14.

For the purpose of recognizing this error, the method shown in FIG. 3 isprovided. This method 30 is carried out continuously by each of thestations 11, 12, 13, 14. The basis for the method 30 is a list which isstored in the respective station and which contains all the identifiersIDENT which are used by the respective station and which thereforecannot be used by other stations for sending messages.

The method 30 is explained below with reference to the exemplaryscenario explained, in which the station 14 erroneously uses theidentifier IDENT2, which can only be used by the station 12.

If the station 12 is in a state in which it is not sending, the station12 reads in at least the identifier IDENT—in a first step 31—of thosemessages 20 which are transmitted by other stations via the bus system10. In a subsequent step 32, the station 12 compares the read-inidentifier IDENT with the identifiers stored in its own list. Since, ashas been explained, the station 12 uses at least the identifier IDENT2,the list of the station 12 contains at least this identifier IDENT2.

The station 12 therefore compares the identifier IDENT which has beenread in by the bus system 10 with the stored identifier IDENT2. If theidentifier IDENT which has been read in is the identifier IDENT2erroneously used by the station 14, the station 12 determines a matchwith the stored identifier IDENT2.

In this case, the station 12 produces an error message in a step 33 andsends this error message to all other stations via the bus system. Thismeans that the error is known to all stations 11, 12, 13, 14 and canthen be rectified by the erroneously acting station 14, for example.

If there is no match, the method 30 is terminated in this respect.

It goes without saying that the station 14 may also be that stationwhich determines the use of the identifier IDENT2 by the station 12. Inthis case, the station 14 produces the error message in accordance withthe step 33 of the method 30. When rectifying the error, it is thenfirst of all necessary to check which station is operating erroneously.It likewise goes without saying that the method 30 in FIG. 3 also comesinto play if more than two stations use the same identifiers.

As has been explained, the method 30 is carried out continuously by allstations 11, 12, 13, 14. Each of the stations 11, 12, 13, 14 thuscompares the identifier IDENT of a transmitted message 20 with theidentifiers IDENTx which it uses itself. If—for whatever reasons—anyidentifier IDENTx is being used by two different stations, this isrecognized by one of the two stations, using the method 30, no laterthan when the other station first sends the identifier IDENTx already inuse as part of a message 20. The error can then be reported andrectified.

Preferably, the method 30 is carried out using a computer program. Tothis end, the computer program is stored in the individual stations 11,12, 13, 14 on an electronic memory and is executed by an electroniccomputer.

1. A method for operating of a bus system having a plurality of stationsconnected thereto, wherein a transmitted message has an identifier(IDENT), and wherein a particular identifier (e.g. IDENT2) may only everbe used by a single station, wherein each of the stations compares theidentifier (IDENT) of a transmitted message with the identifiers whichit uses itself (e.g. IDENT2), and wherein in the event of a match anerror message is produced.
 2. The method as claimed in claim 1, whereineach of the stations has a list containing all the identifiers which ituses itself.
 3. The method as claimed in claim 1, wherein each of thestations reads in at least the identifiers (IDENT) of those messageswhich are transmitted by other stations via the bus system.
 4. Themethod as claimed in claim 3, wherein each of the stations reads inmessages only if it is not itself sending.
 5. A computer programconfigured to be stored on an electronic memory and which is configuredto carry out a method for operating a bus system having a plurality ofstations connected thereto, wherein a transmitted message has anidentifier (IDENT), and wherein a particular identifier (e.g. IDENT2)may only ever be used by a single station wherein each of the stationscompares the identifier (IDENT) of a transmitted message with theidentifiers which it uses itself (e.g. IDENT2), and wherein in the eventof a match an error message is produced.
 6. A computer having anelectronic memory having a computer program stored therein, the computerprogram being configured to carry out a method for operating a bussystem having a plurality of stations connected thereto, wherein atransmitted message has an identifier (IDENT), and wherein a particularidentifier (e.g. IDENT2) may only ever be used by a single stationwherein each of the stations compares the identifier (IDENT) of atransmitted message with the identifiers which it uses itself (e.g.IDENT2), and wherein in the event of a match an error message isproduced.
 7. The method of claim 1, wherein the bus system is a CAN bus.